import request from './request'

// 按需导出API
// 请求首页的数据
export const GetHomeDataAPI = () => request.get('/index/index');

// 获取历史和热门的数据
export const GetHistoryHotApi = () => request.get('/search/index');

// 清除历史记录
export const DelHistoryAPI = () => request.post('/search/clearhistory');

// popup中搜索框实时搜索功能
export const KeepSearchAPI = (params) => request.get('/search/helper', {params})

// 搜索框商品搜索
export const GoodsSearchAPI = (params) => request.get('/goods/list', {params})

// 专题页数据
export const GetTopicAPI = (params) => request.get('/topic/list', {params})

// 登录注册
export const LoginRegisterAPI = (params) => request.post('/auth/loginByWeb', params)

// 分类数据获取
export const GetCategoryAPI = (params) => request.get('/goods/category', {params})


// 分类页面商品列表请求
export const GetCategoryProductAPI = (params) => request.get('/goods/list', {params})

// 产品详情页数据
export const GetProductDetailAPI = (params) => request.get('/goods/detail', {params})

// 品牌详情
export const BrandDetailApi = (params)=> request.get("/brand/detail",{params})

// 商品详情页底部获取购物车总数量
export const GoodsCountAPI = ()=> request.get("/cart/goodscount")

// 加入购物车
export const AddToCartAPI = (params) => request.post('/cart/add', params)

// 获取购物车数据
export const GetCartDataAPI = () => request.get('/cart/index')

// 选中商品接口（含全选）
export const SelectedGoodsAPI = (params) => request.post('/cart/checked', params)

// 购物车页步进器
export const StepAPI = (params) => request.post('/cart/update', params)

// 删除商品
export const DelProductAPI = (params) => request.post('/cart/delete', params)

// 相关产品
export const GetAboutAPI = (params) => request.get('/goods/related', {params})

// 全部分类数据接口
export const CatalogAPI = () => request.get('/catalog/index')

// 获取当前分类数据
export const GetCurrentCategoryAPI = (params) => request.get('/catalog/current', {params})